package org.longgang.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.longgang.bean.Resume;
import org.springframework.stereotype.Repository;

/**
 * ResumeDAO继承基类
 */
@Repository
@Mapper
public interface ResumeDAO extends MyBatisBaseDao<Resume, Integer> {
	@Insert({ "insert into resume(userid) values (#{userid})" })
	@Options(useGeneratedKeys = true, keyProperty = "userid", keyColumn = "userid")
	Integer insertResume(Resume info);
	
	@Update({ "update resume set `name`=#{name},sex=#{sex},birthday=#{birthday},age=#{age},workyear=#{workyear},idcard=#{idcard},phone=#{phone},email=#{email},nativeplace=#{nativeplace},city=#{city},expectcity=#{expectcity},expectsalary=#{expectsalary},postscript=#{postscript} where userid=#{userid}" })
	Integer updateResume(Resume info);
	
	@Select({ "select * from resume where userid= #{userid}" })
	Resume selectResumeById(Resume info);
}